package navigation.wzg.com.navigation.activities;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import navigation.wzg.com.navigation.R;
import navigation.wzg.com.navigation.Soaked.Soaked;

public class About extends AppCompatActivity {

    @BindView(R.id.uu)
    LinearLayout uu;
    @BindView(R.id.update_toolbar)
    Toolbar updateToolbar;
    @BindView(R.id.QQ)
    TextView QQ;
    @BindView(R.id.Tel)
    TextView Tel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        ButterKnife.bind(this);
        Soaked.initState(this, uu);
        updateToolbar.setTitle("关于");
        setSupportActionBar(updateToolbar);
        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);
        updateToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
                overridePendingTransition(R.anim.out, R.anim.up);
            }
        });
    }

    @OnClick({R.id.QQ, R.id.Tel})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.QQ:
                String qqUrl = "mqqwpa://im/chat?chat_type=wpa&uin=2223929266&version=1";
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(qqUrl)));
                break;
            case R.id.Tel:
                Uri uri = Uri.parse("tel:13088888888");
                Intent intent = new Intent(Intent.ACTION_DIAL, uri);
                startActivity(intent);
                break;
        }
    }
}
